﻿using System;
using System.Data;
using Team4Mock.DAO;

namespace Team4Mock.Entity
{
    public class TeamEntity
    {
        TeamDAO td=new TeamDAO();
        private int teamid;
        private int orgid;
        private string teamName;
        private string teamShortDescription;
        private int contactID;
        private string addressLine1;
        private string addressLine2;
        private string addressLine3;
        private string postcode;
        private string town;
        private string county;
        private string country;
        private string typeOfBusiness;
        private string sICCode;
        private string teamFullDescription;
        private string phoneNumber;
        private string fax;
        private string email;
        private string charitynumber;
        private string companynumber;
        private string webAddress;
        private int departmentID;
        private int isactive;
        public TeamEntity()
        { }
        public TeamEntity(string teamName, string teamShortDescription, int contactID, string addressLine1, string addressLine2, string addressLine3, string postcode, string town, string county, string country, string typeOfBusiness, string sICCode, string teamFullDescription, string phoneNumber, string fax, string email, string webAddress, int departmentID)
        {
            this.teamName = teamName;
            this.teamShortDescription = teamShortDescription;
            this.contactID = contactID;
            this.addressLine1 = addressLine1;
            this.addressLine2 = addressLine2;
            this.addressLine3 = addressLine3;
            this.postcode = postcode;
            this.town = town;
            this.county = county;
            this.country = country;
            this.typeOfBusiness = typeOfBusiness;
            this.sICCode = sICCode;
            this.teamFullDescription = teamFullDescription;
            this.phoneNumber = phoneNumber;
            this.fax = fax;
            this.email = email;
            this.webAddress = webAddress;
            this.departmentID = departmentID;
        }

        public string TeamName
        {
            get { return this.teamName; }
            set { this.teamName = value; }
        }
        public string TeamShortDescription
        {
            get { return this.teamShortDescription; }
            set { this.teamShortDescription = value; }
        }
        public string CharityNumber
        {
            get { return this.charitynumber; }
            set { this.charitynumber = value; }
        }
        public string CompanyNumber
        {
            get { return this.companynumber; }
            set { this.companynumber = value; }
        }
        public int ContactID
        {
            get { return this.contactID; }
            set { this.contactID = value; }
        }
        public int IsActive
        {
            get { return this.isactive; }
            set { this.isactive = value; }
        }
        public string AddressLine1
        {
            get { return this.addressLine1; }
            set
            {
                if (value == null)
                    throw new Exception("addressLine1 not allow nullvalue.");
                this.addressLine1 = value;
            }
        }
        public string AddressLine2
        {
            get { return this.addressLine2; }
            set { this.addressLine2 = value; }
        }
        public string AddressLine3
        {
            get { return this.addressLine3; }
            set { this.addressLine3 = value; }
        }
        public string Postcode
        {
            get { return this.postcode; }
            set { this.postcode = value; }
        }
        public string Town
        {
            get { return this.town; }
            set { this.town = value; }
        }
        public string County
        {
            get { return this.county; }
            set { this.county = value; }
        }
        public string Country
        {
            get { return this.country; }
            set { this.country = value; }
        }
        public string TypeOfBusiness
        {
            get { return this.typeOfBusiness; }
            set
            {
                if (value == null)
                    throw new Exception("typeOfBusiness not allow nullvalue.");
                this.typeOfBusiness = value;
            }
        }
        public string SICCode
        {
            get { return this.sICCode; }
            set { this.sICCode = value; }
        }
        public string TeamFullDescription
        {
            get { return this.teamFullDescription; }
            set { this.teamFullDescription = value; }
        }
        public string PhoneNumber
        {
            get { return this.phoneNumber; }
            set { this.phoneNumber = value; }
        }
        public string Fax
        {
            get { return this.fax; }
            set { this.fax = value; }
        }
        public string Email
        {
            get { return this.email; }
            set { this.email = value; }
        }
        public string WebAddress
        {
            get { return this.webAddress; }
            set { this.webAddress = value; }
        }
        public int DepartmentID
        {
            get { return this.departmentID; }
            set { this.departmentID = value; }
        }
        public int TeamID
        {
            get { return this.teamid; }
            set { this.teamid = value; }
        }
        public int OrgID
        {
            get { return this.orgid; }
            set { this.orgid = value; }
        }
        public DataTable GetdataByIDTeam(TeamEntity e)
        {
            return td.GetdataByIDTeam(e.TeamID);
        }
        public DataTable GetdataByDepartment(TeamEntity e)
        {
            return td.GetdataByIDDepart(e.DepartmentID);
        }
        public DataTable CopyOrg(TeamEntity e)
        {
            return td.CopyOrg(e.OrgID);
        }
        public DataTable CopyDepart(TeamEntity e)
        {
            return td.CopyDirec(e.DepartmentID);
        }
        public void Insert(TeamEntity a)
        {
            td.Insert(a.TeamName, a.TeamShortDescription, a.ContactID, a.AddressLine1, a.AddressLine2, a.AddressLine3, a.Postcode, a.Town, a.County, a.Country, a.TypeOfBusiness, a.SICCode, a.TeamFullDescription, a.PhoneNumber, a.Fax, a.WebAddress, a.CharityNumber, a.CompanyNumber, a.DepartmentID, a.IsActive);
        }
        public void Update(TeamEntity a)
        {
            td.Update(a.TeamName, a.TeamShortDescription, a.ContactID, a.AddressLine1, a.AddressLine2, a.AddressLine3, a.Postcode, a.Town, a.County, a.Country, a.TypeOfBusiness, a.SICCode, a.TeamFullDescription, a.PhoneNumber, a.Fax, a.WebAddress, a.CharityNumber, a.CompanyNumber, a.IsActive, a.TeamID);
        }
        public void Del(TeamEntity e)
        {
            td.Del(e.TeamID);
        }

    }
}